-
Notifications
You must be signed in to change notification settings - Fork 55
rust: Add a Rust compatible API implementation. #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
7a556b5 to
f86a047
Compare
pillo79
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, looking forward to see this grow! 🥳 🤗
Kconfig
Outdated
| imply CBPRINTF_FP_SUPPORT | ||
| imply RING_BUFFER | ||
| select UART_INTERRUPT_DRIVEN | ||
| select RUST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should currently be an optional feature, to avoid adding the strong dependency right away.
.github/workflows/build.yml
Outdated
| run: | | ||
| git clone https://github.com/arduino/ArduinoCore-API.git $MODULE_PATH/../ArduinoCore-API | ||
| cp -rfp $MODULE_PATH/../ArduinoCore-API/api $MODULE_PATH/cores/arduino/ | ||
| apt install rustup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recommended way to install Rust is via the rustup.rs installer script, Ubuntu's rustup package from apt is often outdated and may not work correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also,
All initialization is lumped into one "Initialize" step mixing unrelated concerns (cloning API, copying files, Rust setup)...
Better structure:
- name: Clone ArduinoCore-API
[...]
- name: Install Rust toolchain
[...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thank you for your comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soburi you didn't address the first comment, why are we not using curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh instead of apt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed it. It was addressed.
.github/workflows/build.yml
Outdated
| rustup target add thumbv6m-none-eabi | ||
| rustup target add thumbv7em-none-eabihf | ||
| rustup target add thumbv7em-none-eabi | ||
| rustup target add thumbv7m-none-eabi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installing targets one-by-one is slower. Rustup supports installing multiple targets in one command
.github/workflows/build.yml
Outdated
| rustup target add thumbv6m-none-eabi | ||
| rustup target add thumbv7em-none-eabihf | ||
| rustup target add thumbv7em-none-eabi | ||
| rustup target add thumbv7m-none-eabi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| rustup target add thumbv7m-none-eabi | |
| rustup target add thumbv6m-none-eabi thumbv7em-none-eabihf thumbv7em-none-eabi thumbv7m-none-eabi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
We will gradually add a Rust compatible API implementation conforming to Apache-2. This PR adds an alternative implementation of Common.cpp. Signed-off-by: TOKITA Hiroshi <[email protected]>
a6ef806 to
ba14701
Compare
Adding Rust architecture modules for ensure compilation. Signed-off-by: TOKITA Hiroshi <[email protected]>
|
@pillo79 can you please take another look if you still have pending comments? |
pillo79
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I might be missing something huge, but... it still seems to me that effectively Rust is being forced on every core use. What is gating the new add_custom_command in the main CMakeLists.txt?
Again, I think it's awesome to see this working 😍, but IMO it should be optional at this stage.
|
|
||
| if ARDUINO_API | ||
|
|
||
| config USE_ARDUINO_API_RUST_IMPLEMENTATION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am missing where this symbol is effectively used? AFAICS CMakeLists.txt will try to invoke cargo build regardless of this being set or not.
We will gradually add a Rust compatible API implementation conforming to Apache-2.
This PR adds an alternative implementation of Common.cpp.